import java.util.Arrays;
import java.util.Scanner;

/**
 * @Author MDD
 * @Description
 * @Version
 * @Date
 **/
public class No_7 {
    public static void main(String[] args) {
        String[] names = {"王五", "赵四", "乔三", "刘二", "天一"};
        Scanner sc = new Scanner(System.in);
        int[][] grade = {{40, 90, 80, 60, 40, 70}, {60, 80, 70, 60, 40, 90}, {50, 60, 70, 80, 90, 10}, {60, 80, 70, 60, 40, 90}, {60, 70, 80, 90, 70, 70}};
        System.out.print("输入要查询成绩的学生名字：");
        String chioce = sc.nextLine();
        for (int i = 0; i < names.length; i++) {
            if (names[i].equals(chioce)) {
                System.out.println("学生：" + names[i] + "的成绩如下：");
                System.out.println("物理：" + grade[i][0] + "\t英语：" + grade[i][1] + "\t高数" + grade[i][2] + "\t体育:" + grade[i][3] + "\t政治:" + grade[i][4] + "\n");
                break;
            }
        }
        System.out.println("输入要查询不及格人数的科目序号\n");
        System.out.println("1,物理2,英语3,高数4,体育5,政治");
        int fail=sc.nextInt();
        String[] fails=new String[5];
        boolean isFails = false;
        int count=0;
        System.out.println("不及格名单为:");
        for(int i=0;i<names.length;i++){
            if(grade[i][fail-1]<60){
                isFails =true;
                fails[i]=names[i];
                count++;
            }
        }
        for (String y:fails) {
            if (y==null){
                continue;
            }
            System.out.println(y);
        }
        System.out.println("该科目不及格人数为:"+count);
    }
}